{% import 'appbuilder/general/lib.html' as lib %}
{% extends 'appbuilder/general/widgets/base_list.html' %}

    {% block list_header %}
        {{ lib.render_list_header(False, page, page_size, count, filters, actions, modelview_name) }}
    {% endblock %}

    {% block begin_content scoped %}
    <div class="list-group">
    {% endblock %}

    {% block begin_loop_values %}
        {% for item in value_columns %}
        {% set pk = pks[loop.index-1] %}
        <div class="list-group-item">
            {% if item['exc_text'] or item['stack_info']:%}
            <span class="traceback"></span>
            {% endif %}
            <div class="log {{item['levelname'].lower()}}">
                <span class="created">{{formatters_columns['created'](item['created'])}}</span>
                <strong class="levelname">{{item['levelname']}}</strong>
                <span class="filename">{{item['filename']}}:{{item['lineno']}}</span>
                {% if item['backend']: %}
                <span class="backend">{{item['backend']}}</span>
                {% endif %}
                {{item['msg']|safe}}
            </div>
            <div class="exception">
                {% if item['exc_text']:%}
                <div class="exc-text"><span>Exception:</span>{{formatters_columns['exc_text'](item['exc_text'])|safe}}</div>
                {% endif %}
                {% if item['stack_info']:%}
                <div class="stack-info"><span>Call Stack</span><br>{{formatters_columns['stack_info'](item['stack_info'])|safe}}</div>
                {% endif %}
            </div>
            <div class="detail">
                <span class="title">Details</span>
                <p>
                    <strong>ID:</strong>{{item['id']}}<br>
                    <strong>Name:</strong>{{item['name']}}<br>
                    <strong>PathName:</strong>{{item['pathname']}}<br>
                    <strong>Module:</strong>{{item['module']}}<br>
                    <strong>Function:</strong>{{item['funcName']}}<br>
                    <strong>ThreadName:</strong>{{item['threadName']}}<br>
                    <strong>ThreadID:</strong>{{item['thread']}}
                </p>
            </div>
        </div>
        {% endfor %}
    {% endblock %}

    {% block end_content scoped %}
        </div>
    {% endblock %}

